package com.wc.算法基础课.A第一讲基础算法.递归.有序分数;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/3/13 1:07
 * @description https://www.acwing.com/problem/content/1362/
 */
public class Main {
    static int n;

    // 思路： a / b, c / d 之间有一个 (a + c) / (b + d)
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        System.out.println("0/1");
        dfs(0, 1, 1, 1);
        System.out.println("1/1");
    }

    static void dfs(int a, int b, int c, int d) {
        if (b + d > n) return;
        dfs(a, b, a + c, b + d);
        System.out.println((a + c) + "/" + (b + d));
        dfs(a + c, b + d, c, d);
    }
}
